/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package processors;

import readers.QueryStringHandler;

/**
 *
 * @author Chris
 */
public class ProcessorFactory {
    private ProcessorFactory() { }
    
    public static processor createProcessor(String query) {
        QueryStringHandler qsh = new QueryStringHandler(query);
        String elm = qsh.getElement("category");
        if(elm.compareTo("login") == 0)
            return new processorLogin(query);
        
        if(elm.compareTo("listQuizzes") == 0)
            return new processorAvailableQuizzes(query);
        
        if(elm.compareTo("getScores") == 0)
            return new processorQuizScores(query);
        
        if(elm.compareTo("getQuiz") == 0)
            return new processorQuizWords(query);
        
        return new processorLogin(query);
    }
}
